package com.shujia.method_.seven;

import java.util.Arrays;

public class MethodDemo3 {

    // 形参的传递, 值传递
    public static void main(String[] args) {
        int[] arr = {10, 20};
        System.out.println(Arrays.toString(arr));
        transfer(arr);
        System.out.println(Arrays.toString(arr));
    }

    public static void transfer(int[] arr) {
        
        arr[0] = arr[0] ^ arr[1];
        arr[1] = arr[0] ^ arr[1];
        arr[0] = arr[0] ^ arr[1];
        System.out.println(Arrays.toString(arr));

    }
}
